<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>

</head>
<body>
<form id="formId" target="frame1" method="POST" enctype="multipart/form-data">
   <!-- <input type="text" name="username">-->
    <input type="file" name="file"/>
    <input type="button" value="提交" onclick="upload()">
    <input type="button" value="预览" onclick="viewer()">

    <br>
    <input type="button" value="word转换pdf" onclick="doc2pdf()">
    <br>
    <input type="button" value="image转换pdf" onclick="img2pdf()">
    <br>
    <input type="button" value="text转换pdf" onclick="txt2pdf()">
</form>

<iframe name="frame1" frameborder="0" height="40"></iframe>

<script type="text/javascript">
    function upload() {
        var form=$('#formId');
        form.attr('action','/pdfserver/testUpload3');
        form.submit();
        // $("#formId").submit();
    }
    function doc2pdf() {
        var form=$('#formId');
        form.attr('action','/pdfserver/doc2pdf');
        // window.open("http://localhost:9082/pdfserver/web/viewer.html?file=http://localhost:9082/pdfserver/doc2pdf");
        form.submit();
    }

    function img2pdf() {
        var form=$('#formId');
        form.attr('action','/pdfserver/img2pdf');
        form.submit();
    }

    function txt2pdf() {
        var form=$('#formId');
        form.attr('action','/pdfserver/txt2pdf');
        form.submit();
    }

    function viewer() {
        window.open("http://localhost:9082/pdfserver/web/viewer.html");
    }
</script>

</body>
</html>